home *** CD-ROM | disk | FTP | other *** search
- Path: news.mira.net.au!news
- From: davidw@werple.net.au (David White)
- Newsgroups: comp.lang.c++
- Subject: Re: Is there a standard for * and & placement style?
- Date: 23 Feb 1996 20:28:08 +1100
- Organization: Werple Internet, Melbourne
- Message-ID: <4gk1b8$mtm@werple.net.au>
- References: <3128BD31.4AF8@wildfire.com> <marnoldDn27q9.Is0@netcom.com> <4gckd5$bc7@clarknet.clark.net> <marnoldDn63vB.H6n@netcom.com>
- NNTP-Posting-Host: werple.mira.net.au
-
- marnold@netcom.com (Matt Arnold) writes:
-
- >gusty@clark.net (Harlan Messinger) writes:
-
- >>I think the syntax is dumb in the first place. One declaration statement
- >>should declare variables of one type. I think
-
- >> char* a, b, c;
-
- >>should declare three (char*) variables. If someone also wants a char
- >>variable d, then that should be on two lines:
-
- >That would be better, but I still subscribe to the "one concept per
- >line" theory of programming and would never declare three variables on
- >a single line.
-
- The concept used in declarations is that a declaration mimics an
- expression, e.g., given char *p, if you see *p then it evaluates to a
- char. The above form is therefore a special case because it can't always
- be used. In the case of, for example, char (*p)[10], you can't apply it.
- I can see that in the trivial special cases, like char* foo(), it seems
- more sensible to some people (foo() returns a char*), but it is an oddity
- in terms of the general rule.
-
- David White
- davidw@werple.mira.net.au
-